package abs.service;

import abs.domain.Companias;
import abs.domain.Documentos;
import abs.domain.GrupoClientes;
import abs.domain.GrupoProveedores;
import abs.domain.Proveedores;
import abs.domain.Retenciones;
import abs.domain.Sucursales;
import abs.domain.TipoClientes;
import abs.domain.TipoProveedores;

import java.util.List;
import java.util.Set;

import org.junit.Test;

import org.junit.runner.RunWith;

import org.springframework.beans.factory.annotation.Autowired;

import org.springframework.beans.factory.support.DefaultListableBeanFactory;

import org.springframework.context.ApplicationContext;

import org.springframework.mock.web.MockHttpServletRequest;

import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.TestExecutionListeners;

import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

import org.springframework.test.context.support.DependencyInjectionTestExecutionListener;
import org.springframework.test.context.support.DirtiesContextTestExecutionListener;

import org.springframework.test.context.transaction.TransactionalTestExecutionListener;

import org.springframework.transaction.annotation.Transactional;

import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.RequestScope;
import org.springframework.web.context.request.ServletRequestAttributes;
import org.springframework.web.context.request.SessionScope;

/**
 * Class to run the service as a JUnit test. Each operation in the service is a separate test.
 *
 */

@RunWith(SpringJUnit4ClassRunner.class)
@TestExecutionListeners({
		DependencyInjectionTestExecutionListener.class,
		DirtiesContextTestExecutionListener.class,
		TransactionalTestExecutionListener.class })
@ContextConfiguration(locations = {
		"file:./resources/absWeb-security-context.xml",
		"file:./resources/absWeb-service-context.xml",
		"file:./resources/absWeb-dao-context.xml",
		"file:./resources/absWeb-web-context.xml" })
@Transactional
public class CompaniasServiceTest {

	/**
	 * The Spring application context.
	 *
	 */
	@SuppressWarnings("unused")
	private ApplicationContext context;

	/**
	 * The service being tested, injected by Spring.
	 *
	 */
	@Autowired
	protected CompaniasService service;

	/**
	 * Instantiates a new CompaniasServiceTest.
	 *
	 */
	public CompaniasServiceTest() {
		setupRequestContext();
	}

	/**
	 * Operation Unit Test
	 * Save an existing Sucursales entity
	 * 
	 */
	@Test
	public void saveCompaniasSucursaleses() {
		// TODO: JUnit - Populate test inputs for operation: saveCompaniasSucursaleses 
		String co000nocia = null;
		Sucursales related_sucursaleses = new abs.domain.Sucursales();
		Companias response = null;
		response = service.saveCompaniasSucursaleses(co000nocia, related_sucursaleses);
		// TODO: JUnit - Add assertions to test outputs of operation: saveCompaniasSucursaleses
	}

	/**
	 * Operation Unit Test
	 */
	@Test
	public void findCompaniasByPrimaryKey() {
		// TODO: JUnit - Populate test inputs for operation: findCompaniasByPrimaryKey 
		String co000nocia_1 = null;
		Companias response = null;
		response = service.findCompaniasByPrimaryKey(co000nocia_1);
		// TODO: JUnit - Add assertions to test outputs of operation: findCompaniasByPrimaryKey
	}

	/**
	 * Operation Unit Test
	 * Save an existing Retenciones entity
	 * 
	 */
	@Test
	public void saveCompaniasRetencioneses() {
		// TODO: JUnit - Populate test inputs for operation: saveCompaniasRetencioneses 
		String co000nocia_2 = null;
		Retenciones related_retencioneses = new abs.domain.Retenciones();
		Companias response = null;
		response = service.saveCompaniasRetencioneses(co000nocia_2, related_retencioneses);
		// TODO: JUnit - Add assertions to test outputs of operation: saveCompaniasRetencioneses
	}

	/**
	 * Operation Unit Test
	 * Delete an existing GrupoProveedores entity
	 * 
	 */
	@Test
	public void deleteCompaniasGrupoProveedoreses() {
		// TODO: JUnit - Populate test inputs for operation: deleteCompaniasGrupoProveedoreses 
		String companias_co000nocia = null;
		String related_grupoproveedoreses_grppr100cdgo = null;
		Companias response = null;
		response = service.deleteCompaniasGrupoProveedoreses(companias_co000nocia, related_grupoproveedoreses_grppr100cdgo);
		// TODO: JUnit - Add assertions to test outputs of operation: deleteCompaniasGrupoProveedoreses
	}

	/**
	 * Operation Unit Test
	 * Save an existing GrupoClientes entity
	 * 
	 */
	@Test
	public void saveCompaniasGrupoClienteses() {
		// TODO: JUnit - Populate test inputs for operation: saveCompaniasGrupoClienteses 
		String co000nocia_3 = null;
		GrupoClientes related_grupoclienteses = new abs.domain.GrupoClientes();
		Companias response = null;
		response = service.saveCompaniasGrupoClienteses(co000nocia_3, related_grupoclienteses);
		// TODO: JUnit - Add assertions to test outputs of operation: saveCompaniasGrupoClienteses
	}

	/**
	 * Operation Unit Test
	 * Delete an existing Companias entity
	 * 
	 */
	@Test
	public void deleteCompanias() {
		// TODO: JUnit - Populate test inputs for operation: deleteCompanias 
		Companias companias = new abs.domain.Companias();
		service.deleteCompanias(companias);
	}

	/**
	 * Operation Unit Test
	 * Delete an existing TipoClientes entity
	 * 
	 */
	@Test
	public void deleteCompaniasTipoClienteses() {
		// TODO: JUnit - Populate test inputs for operation: deleteCompaniasTipoClienteses 
		String companias_co000nocia_1 = null;
		String related_tipoclienteses_tipocl100cdgo = null;
		Companias response = null;
		response = service.deleteCompaniasTipoClienteses(companias_co000nocia_1, related_tipoclienteses_tipocl100cdgo);
		// TODO: JUnit - Add assertions to test outputs of operation: deleteCompaniasTipoClienteses
	}

	/**
	 * Operation Unit Test
	 * Save an existing Proveedores entity
	 * 
	 */
	@Test
	public void saveCompaniasProveedoreses() {
		// TODO: JUnit - Populate test inputs for operation: saveCompaniasProveedoreses 
		String co000nocia_4 = null;
		Proveedores related_proveedoreses = new abs.domain.Proveedores();
		Companias response = null;
		response = service.saveCompaniasProveedoreses(co000nocia_4, related_proveedoreses);
		// TODO: JUnit - Add assertions to test outputs of operation: saveCompaniasProveedoreses
	}

	/**
	 * Operation Unit Test
	 * Load an existing Companias entity
	 * 
	 */
	@Test
	public void loadCompaniass() {
		Set<Companias> response = null;
		response = service.loadCompaniass();
		// TODO: JUnit - Add assertions to test outputs of operation: loadCompaniass
	}

	/**
	 * Operation Unit Test
	 * Delete an existing GrupoClientes entity
	 * 
	 */
	@Test
	public void deleteCompaniasGrupoClienteses() {
		// TODO: JUnit - Populate test inputs for operation: deleteCompaniasGrupoClienteses 
		String companias_co000nocia_2 = null;
		String related_grupoclienteses_grpcl100cdgo = null;
		Companias response = null;
		response = service.deleteCompaniasGrupoClienteses(companias_co000nocia_2, related_grupoclienteses_grpcl100cdgo);
		// TODO: JUnit - Add assertions to test outputs of operation: deleteCompaniasGrupoClienteses
	}

	/**
	 * Operation Unit Test
	 * Save an existing GrupoProveedores entity
	 * 
	 */
	@Test
	public void saveCompaniasGrupoProveedoreses() {
		// TODO: JUnit - Populate test inputs for operation: saveCompaniasGrupoProveedoreses 
		String co000nocia_5 = null;
		GrupoProveedores related_grupoproveedoreses = new abs.domain.GrupoProveedores();
		Companias response = null;
		response = service.saveCompaniasGrupoProveedoreses(co000nocia_5, related_grupoproveedoreses);
		// TODO: JUnit - Add assertions to test outputs of operation: saveCompaniasGrupoProveedoreses
	}

	/**
	 * Operation Unit Test
	 * Delete an existing Sucursales entity
	 * 
	 */
	@Test
	public void deleteCompaniasSucursaleses() {
		// TODO: JUnit - Populate test inputs for operation: deleteCompaniasSucursaleses 
		String companias_co000nocia_3 = null;
		String related_sucursaleses_co001cdgo = null;
		Companias response = null;
		response = service.deleteCompaniasSucursaleses(companias_co000nocia_3, related_sucursaleses_co001cdgo);
		// TODO: JUnit - Add assertions to test outputs of operation: deleteCompaniasSucursaleses
	}

	/**
	 * Operation Unit Test
	 * Return a count of all Companias entity
	 * 
	 */
	@Test
	public void countCompaniass() {
		Integer response = null;
		response = service.countCompaniass();
		// TODO: JUnit - Add assertions to test outputs of operation: countCompaniass
	}

	/**
	 * Operation Unit Test
	 * Delete an existing TipoProveedores entity
	 * 
	 */
	@Test
	public void deleteCompaniasTipoProveedoreses() {
		// TODO: JUnit - Populate test inputs for operation: deleteCompaniasTipoProveedoreses 
		String companias_co000nocia_4 = null;
		String related_tipoproveedoreses_tipopr100cdgo = null;
		Companias response = null;
		response = service.deleteCompaniasTipoProveedoreses(companias_co000nocia_4, related_tipoproveedoreses_tipopr100cdgo);
		// TODO: JUnit - Add assertions to test outputs of operation: deleteCompaniasTipoProveedoreses
	}

	/**
	 * Operation Unit Test
	 * Save an existing TipoProveedores entity
	 * 
	 */
	@Test
	public void saveCompaniasTipoProveedoreses() {
		// TODO: JUnit - Populate test inputs for operation: saveCompaniasTipoProveedoreses 
		String co000nocia_6 = null;
		TipoProveedores related_tipoproveedoreses = new abs.domain.TipoProveedores();
		Companias response = null;
		response = service.saveCompaniasTipoProveedoreses(co000nocia_6, related_tipoproveedoreses);
		// TODO: JUnit - Add assertions to test outputs of operation: saveCompaniasTipoProveedoreses
	}

	/**
	 * Operation Unit Test
	 * Save an existing TipoClientes entity
	 * 
	 */
	@Test
	public void saveCompaniasTipoClienteses() {
		// TODO: JUnit - Populate test inputs for operation: saveCompaniasTipoClienteses 
		String co000nocia_7 = null;
		TipoClientes related_tipoclienteses = new abs.domain.TipoClientes();
		Companias response = null;
		response = service.saveCompaniasTipoClienteses(co000nocia_7, related_tipoclienteses);
		// TODO: JUnit - Add assertions to test outputs of operation: saveCompaniasTipoClienteses
	}

	/**
	 * Operation Unit Test
	 * Delete an existing Retenciones entity
	 * 
	 */
	@Test
	public void deleteCompaniasRetencioneses() {
		// TODO: JUnit - Populate test inputs for operation: deleteCompaniasRetencioneses 
		String companias_co000nocia_5 = null;
		String related_retencioneses_rt100cdgo = null;
		Companias response = null;
		response = service.deleteCompaniasRetencioneses(companias_co000nocia_5, related_retencioneses_rt100cdgo);
		// TODO: JUnit - Add assertions to test outputs of operation: deleteCompaniasRetencioneses
	}

	/**
	 * Operation Unit Test
	 * Save an existing Companias entity
	 * 
	 */
	@Test
	public void saveCompanias() {
		// TODO: JUnit - Populate test inputs for operation: saveCompanias 
		Companias companias_1 = new abs.domain.Companias();
		service.saveCompanias(companias_1);
	}

	/**
	 * Operation Unit Test
	 * Delete an existing Proveedores entity
	 * 
	 */
	@Test
	public void deleteCompaniasProveedoreses() {
		// TODO: JUnit - Populate test inputs for operation: deleteCompaniasProveedoreses 
		String companias_co000nocia_6 = null;
		Integer related_proveedoreses_pr100copr = 0;
		Companias response = null;
		response = service.deleteCompaniasProveedoreses(companias_co000nocia_6, related_proveedoreses_pr100copr);
		// TODO: JUnit - Add assertions to test outputs of operation: deleteCompaniasProveedoreses
	}

	/**
	 * Operation Unit Test
	 * Return all Companias entity
	 * 
	 */
	@Test
	public void findAllCompaniass() {
		// TODO: JUnit - Populate test inputs for operation: findAllCompaniass 
		Integer startResult = 0;
		Integer maxRows = 0;
		List<Companias> response = null;
		response = service.findAllCompaniass(startResult, maxRows);
		// TODO: JUnit - Add assertions to test outputs of operation: findAllCompaniass
	}

	/**
	 * Operation Unit Test
	 * Save an existing Documentos entity
	 * 
	 */
	@Test
	public void saveCompaniasDocumentoses() {
		// TODO: JUnit - Populate test inputs for operation: saveCompaniasDocumentoses 
		String co000nocia_8 = null;
		Documentos related_documentoses = new abs.domain.Documentos();
		Companias response = null;
		response = service.saveCompaniasDocumentoses(co000nocia_8, related_documentoses);
		// TODO: JUnit - Add assertions to test outputs of operation: saveCompaniasDocumentoses
	}

	/**
	 * Operation Unit Test
	 * Delete an existing Documentos entity
	 * 
	 */
	@Test
	public void deleteCompaniasDocumentoses() {
		// TODO: JUnit - Populate test inputs for operation: deleteCompaniasDocumentoses 
		String companias_co000nocia_7 = null;
		String related_documentoses_co030codi = null;
		Companias response = null;
		response = service.deleteCompaniasDocumentoses(companias_co000nocia_7, related_documentoses_co030codi);
		// TODO: JUnit - Add assertions to test outputs of operation: deleteCompaniasDocumentoses
	}

	/**
	 * Autowired to set the Spring application context.
	 *
	 */
	@Autowired
	public void setContext(ApplicationContext context) {
		this.context = context;
		((DefaultListableBeanFactory) context.getAutowireCapableBeanFactory()).registerScope("session", new SessionScope());
		((DefaultListableBeanFactory) context.getAutowireCapableBeanFactory()).registerScope("request", new RequestScope());
	}

	/**
	 * Sets Up the Request context
	 *
	 */
	private void setupRequestContext() {
		MockHttpServletRequest request = new MockHttpServletRequest();
		ServletRequestAttributes attributes = new ServletRequestAttributes(request);
		RequestContextHolder.setRequestAttributes(attributes);
	}
}
